home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / include / gsl / gsl_spline.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-04-20  |  2.6 KB  |  99 lines

  1. /* interpolation/gsl_spline.h
  2.  * 
  3.  * Copyright (C) 2001 Brian Gough
  4.  * 
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or (at
  8.  * your option) any later version.
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #ifndef __GSL_SPLINE_H__
  21. #define __GSL_SPLINE_H__
  22. #include <stdlib.h>
  23. #include <gsl/gsl_interp.h>
  24.  
  25. #undef __BEGIN_DECLS
  26. #undef __END_DECLS
  27. #ifdef __cplusplus
  28. # define __BEGIN_DECLS extern "C" {
  29. # define __END_DECLS }
  30. #else
  31. # define __BEGIN_DECLS /* empty */
  32. # define __END_DECLS /* empty */
  33. #endif
  34.  
  35. __BEGIN_DECLS
  36.  
  37.  
  38. /* general interpolation object */
  39. typedef struct {
  40.   gsl_interp * interp;
  41.   double  * x;
  42.   double  * y;
  43.   size_t  size;
  44. } gsl_spline;
  45.  
  46. gsl_spline *
  47. gsl_spline_alloc(const gsl_interp_type * T, size_t n);
  48.      
  49. int
  50. gsl_spline_init(gsl_spline * spline, const double xa[], const double ya[], size_t size);
  51.  
  52.  
  53. int
  54. gsl_spline_eval_e(const gsl_spline * spline, double x,
  55.                   gsl_interp_accel * a, double * y);
  56.  
  57. double
  58. gsl_spline_eval(const gsl_spline * spline, double x, gsl_interp_accel * a);
  59.  
  60. int
  61. gsl_spline_eval_deriv_e(const gsl_spline * spline,
  62.                         double x,
  63.             gsl_interp_accel * a,
  64.                         double * y);
  65.  
  66. double
  67. gsl_spline_eval_deriv(const gsl_spline * spline,
  68.                       double x,
  69.               gsl_interp_accel * a);
  70.  
  71. int
  72. gsl_spline_eval_deriv2_e(const gsl_spline * spline,
  73.                          double x,
  74.              gsl_interp_accel * a,
  75.                          double * y);
  76.  
  77. double
  78. gsl_spline_eval_deriv2(const gsl_spline * spline,
  79.                        double x,
  80.                gsl_interp_accel * a);
  81.  
  82. int
  83. gsl_spline_eval_integ_e(const gsl_spline * spline,
  84.                         double a, double b,
  85.             gsl_interp_accel * acc,
  86.                         double * y);
  87.  
  88. double
  89. gsl_spline_eval_integ(const gsl_spline * spline,
  90.                       double a, double b,
  91.               gsl_interp_accel * acc);
  92.  
  93. void
  94. gsl_spline_free(gsl_spline * spline);
  95.  
  96. __END_DECLS
  97.  
  98. #endif /* __GSL_INTERP_H__ */
  99.